package dominio;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.*;

/**
 * @author DEVAIR
 * @version 1.0 @created 02-nov-2013 16:59:06
 */
@Entity
@Table(name = "pasta")
@SequenceGenerator(name = "pastaseq",initialValue=1,allocationSize=1)
@NamedQueries({
    @NamedQuery(name = "pastaroot", query = "select e from PastaMd e where e.pasta is null")
})

public class PastaMd implements Serializable{
   
    
    @OneToMany(mappedBy = "pasta")
    private List<PastaMd> pastaMds;
 
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "pastaseq")
    @Column(name = "id")
    private long id;
    
    @Column(name = "nome",nullable=false)      
    private String nome;
    
    @Column(name="data_criacao",nullable=false)
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date dataCriacao;
    
    @Column(name="data_alteracao",nullable=true)
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date dataAlteracao;    
               
    @ManyToOne
    private PastaMd pasta;
               
    
    @OneToMany(mappedBy = "pasta")
    private List<ArquivoMd> arquivoMds;
    
    /**
     * @return the id
     */
    public long getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(long id) {
        this.id = id;
    }

    /**
     * @return the nome
     */
    public String getNome() {
        return nome;
    }

    /**
     * @param nome the nome to set
     */
    public void setNome(String nome) {
        this.nome = nome;
    }

    /**
     * @return the dataCriacao
     */
    public Date getDataCriacao() {
        return dataCriacao;
    }

    /**
     * @param dataCriacao the dataCriacao to set
     */
    public void setDataCriacao(Date dataCriacao) {
        this.dataCriacao = dataCriacao;
    }

    /**
     * @return the dataAlteracao
     */
    public Date getDataAlteracao() {
        return dataAlteracao;
    }

    /**
     * @param dataAlteracao the dataAlteracao to set
     */
    public void setDataAlteracao(Date dataAlteracao) {
        this.dataAlteracao = dataAlteracao;
    }

    /**
     * @return the pastas
     */


    /**
     * @return the pastaMds
     */
    public List<PastaMd> getPastaMds() {
        return pastaMds;
    }

    /**
     * @param pastaMds the pastaMds to set
     */
    public void setPastaMds(List<PastaMd> pastaMds) {
        this.pastaMds = pastaMds;
    }

    /**
     * @return the pasta
     */
    public PastaMd getPasta() {
        return pasta;
    }

    /**
     * @param pasta the pasta to set
     */
    public void setPasta(PastaMd pasta) {
        this.pasta = pasta;
    }

    /**
     * @return the arquivoMds
     */
    public List<ArquivoMd> getArquivoMds() {
        return arquivoMds;
    }

    /**
     * @param arquivoMds the arquivoMds to set
     */
    public void setArquivoMds(List<ArquivoMd> arquivoMds) {
        this.arquivoMds = arquivoMds;
    }
}